#ifndef _COMPREHENSIONTYPE_H_
#define _COMPREHENSIONTYPE_H_
#include "SimpleNode.h"
#include "AstTypes.h"
class IVisitor;
class comprehensionType;
typedef QSharedPointer<comprehensionType> comprehensionTypePtr;

class comprehensionType: public SimpleNode
{
public:
    explicit comprehensionType(int nodeId=-1);
    virtual ~comprehensionType();
    
    
    
    virtual Ast::AstTypes type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<comprehensionTypePtr> ComprehensionTypePtrListIterator;

class ComprehensionTypeList: public QList<comprehensionTypePtr>
{
public:
    inline ComprehensionTypeList() { }
    inline explicit ComprehensionTypeList(comprehensionTypePtr i) { append(i); }
    inline ComprehensionTypeList(const ComprehensionTypeList &l) : QList<comprehensionTypePtr>(l) { }
    inline ComprehensionTypeList(const QList<comprehensionTypePtr> &l) : QList<comprehensionTypePtr>(l) { }

    inline ComprehensionTypeList operator+(const ComprehensionTypeList &other) const
    { ComprehensionTypeList n = *this; n += other; return n; }
    inline ComprehensionTypeList &operator<<(comprehensionTypePtr it)
    { append(it); return *this; }
    inline ComprehensionTypeList &operator<<(const ComprehensionTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("ComprehensionTypeList(");
        foreach(comprehensionTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(comprehensionTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif